package sn

import (
	"fmt"
	"time"
	"xialou_platform/app/tools"
)

type SnPrefix string

const (
	SN_PREFIX_VIP_ORDER    SnPrefix = "OV" //会员订单前缀 order vip
	SN_PREFIX_GOODS_ORDER  SnPrefix = "GV" //商品订单前缀 order vip
	SN_PREFIX_VIP_REFUND            = "VRF"
	SN_PREFIX_GOODS_REFUND          = "GRF"
	SN_PREFIX_ORDER        SnPrefix = "XL"  //下楼订单前缀 order
	SN_PREFIX_REFUND_ORDER SnPrefix = "RXL" //退款订单前缀 order
)

func GenSn(snPrefix SnPrefix) string {
	return fmt.Sprintf("%s%s%s", snPrefix, time.Now().Format("20060102150405"), tools.Krand(8, tools.KC_RAND_KIND_NUM))
}
